import * as React from 'react';
import {View, Text, Button} from 'react-native';
import {context} from '../../store';

const {useContext} = React;

function BTest() {
  let [state, dispatch] = useContext(context);
  const changeState = () => {
    dispatch({type: 'changeUserInfo', data: {name: '测试名'}});
  };
  return (
    <View>
      <Text>BTest</Text>
      <Button onPress={changeState} title="点击改变全局变量"></Button>
    </View>
  );
}

export default BTest;
